<?php Yii::app()->clientScript->registerScript('historyappt', "
            $('.history-appointment').slimScroll({
        position: 'right',
        width: '497px',
        railVisible: true,
    });
    ");
?>
<div class="row-fluid">
    <div class="box span12">
        <div class="box-header">
            <h2><i class="icon-calendar"></i>Whole Appointment</h2>
            <div class="box-icon">
                <a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
            </div>
        </div>
        <div class="box-content notes-list">
            <ul class="dashboard-list history-appointment">
                <?php if ($history_appoint != NULL): ?>
                    <?php foreach ($history_appoint as $_apt): ?>
                        <?php
                        if ($_apt->appt && $_apt->appt->service && $_apt->appt->service->user):
                            $service = $_apt->appt->service;
                            ?>
                            <li>
                                <div class="row-fluid">
                                    <div class="span2">
                                        <?php $sv_url  = $this->isAdmin ? $service->editUrl : '#' ?>
                                        <p class="clearfix">  <a target="_blank" href="<?php echo $sv_url ?>" title="<?php echo $service->s_name ?>">
                                                <img class="avatar" src="<?php echo $service->get_avatar_by_size(50, 50); ?>">
                                            </a></p>
                                        <?php if ($_apt->order): ?>

                                            <?php echo $_apt->order->statusLabel ?>
                                        <?php endif; ?>
                                    </div>
                                    <div class="span10"> <div class="right-content">
                                            <a target="_blank" href="<?php echo $sv_url ?>"><?php echo $service->s_name ?></a><br>
                                            <span class="muted">at <?php echo date('D, F dS, Y', $_apt->appt->date) ?></span><br>
                                            <span class="muted">Staff: 
                                                <a target="_blank" href="<?php echo $_apt->appt->author->editUrl ?>"><?php echo $_apt->appt->author->name ?></a></span><br>
                                            <a target="_blank" href="<?php echo $service->user->editUrl ?>"><strong><?php echo $service->user->name ?></strong></a>
                                            <br>
                                            <?php if ($_apt->review): ?>
                                                Review point:&nbsp;
                                                <?php $frontend_assetDirWeb = Yii::app()->baseUrl . '/themes/frontend/assets/'; ?>
                                                <a href="<?php echo Yii::app()->createUrl('review/edit', array('pk' => $_apt->review->id)) ?>">
                                                    <img src="<?php echo $frontend_assetDirWeb ?>img/star/rating_stars_small_<?php echo $_apt->review->average ?>.png">
                                                    <br>
                                                </a>
                                                Review comment <span class="muted">"<?php echo $_apt->review->comment ?>"</span><br>
                                            <?php endif; ?>
                                            <?php if ($_apt->order): ?>
                                                <?php
                                                if ($_apt->order->status == Orders::STATUS_COMPLETED):
                                                    $order_price = $_apt->order->receipt ? $_apt->order->receipt->final_price : 0
                                                    ?>
                                                    Amount paid: $<?php echo $order_price ?>
                                                <?php else: ?>
                                                    Amount: $<?php echo $_apt->order->getPrice() ?>
                                                <?php endif; ?>
                                            <?php endif; ?>
                                        </div> </div>
                                </div>
                            </li>
                        <?php endif; ?>
                        <div class="clearfix"></div>
                    <?php endforeach; ?>
                <?php endif; ?>
            </ul>
            <div class="clearfix"></div>
        </div>
    </div>
</div>